package com.grouppurchase.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.alibaba.fastjson.JSON;

@Data
@EqualsAndHashCode(callSuper = true)
@TableName("products")
@ApiModel("商品实体")
public class Product extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @ApiModelProperty("商品ID")
    private Long id;

    @ApiModelProperty("商品名称")
    private String name;

    @ApiModelProperty("商品描述")
    private String description;

    @ApiModelProperty("商品图片JSON数组")
    private String images;

    @ApiModelProperty("原价（分）")
    private Long originalPrice;

    @ApiModelProperty("团购价（分）")
    private Long groupPrice;

    @ApiModelProperty("库存数量")
    private Integer stock;

    @ApiModelProperty("锁定库存")
    private Integer lockStock;

    @ApiModelProperty("团购类型：traditional传统|lottery抽奖")
    private String groupType;

    @ApiModelProperty("抽奖配置JSON")
    private String lotteryConfig;

    @ApiModelProperty("安慰奖金额（分）")
    private Integer consolationPrize;

    @ApiModelProperty("分类ID")
    private Long categoryId;

    @ApiModelProperty("运费模板ID")
    private Long freightTemplateId;

    @ApiModelProperty("状态：1上架，0下架")
    private Integer status;

    @ApiModelProperty("排序")
    private Integer sortOrder;
}
